package com.rr;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import rr.service.OrderService;

import java.io.IOException;

/**
 * @author : RENBIAO
 * @createTime : 2021/7/9 13:57
 */
//@SpringBootApplication
//@ImportResource(locations = {"classpath:consumer.xml"})
public class GmallConsumerDubboApplication {

    @SuppressWarnings("resource")
    public static void main(String[] args) throws IOException {
//        SpringApplication.run(GmallConsumerDubboApplication.class, args);
//        ClassPathXmlApplicationContext context =
//                new ClassPathXmlApplicationContext("classpath:consumer.xml");
//
//        context.start();
//
//        System.in.read();
        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("consumer.xml");

        OrderService orderService = applicationContext.getBean(OrderService.class);

        orderService.initOrder("10001");
        System.out.println("调用完成....");
        System.in.read();
    }
}
